package com.hyjr.RxTask.demo;

import java.util.Date;

public class RxMsg {
	private String msguid;
	private byte msgtype;
	private byte status;
	private Date timestamp;
	private String desc;
	private Object body;
	
    /** sign: 0x01 ~ 0x03 ============================================= */
    public static final byte REQUEST              	= 0x01;    // 
    public static final byte RESPONSE             	= 0x02;    // 
    public static final byte NOTICE                	= 0x03;    //
    public static final byte PUT                	= 0x04;    //


    /** msgtype: 0x11 ~ 0x23 ============================================= */
    public static final byte PUSH                	= 0x11;    // 
    public static final byte RESULT              	= 0x12;    // 
    public static final byte QUERY                	= 0x13;    // 
    public static final byte RECONN                	= 0x14;    // 

    /** devtype: 0x31 ~ 0x36 ============================================= */
    public static final byte HOST                  	= 0x31;    // 
    public static final byte NETWARE              	= 0x32;    // 
    public static final byte MIDDLEWARE        		= 0x43;    // 
    public static final byte DATABASE               = 0x54;    // 
    
    /** status: 0x41 ~ 0x44 =========================================== */
    public static final byte SUCCESS               = 0x41;    // 4
    public static final byte REQUEST_ERROR         = 0x42;    // 5
    public static final byte SERVER_BUSY           = 0x43;    // 5
    public static final byte SERVER_ERROR          = 0x44;    // 5

	public RxMsg(){
		
	}
	
	public RxMsg(String msguid, byte msgtype, byte status, String desc, Object body)
	{
		this.msguid= msguid;
		this.msgtype = msgtype;
		this.status = status;
		this.timestamp = new Date();
		this.desc = desc;
		this.body= body;
	}
	
    public String getMsgUid() {
        return msguid;
    }

    public void setMsgUid(String msguid) {
        this.msguid = msguid;
    }
    
    public byte getStatus() {
        return status;
    }

    public void setStatus(byte status) {
        this.status = status;
    }
    
    public Date getTimeStatmp() {
        return timestamp;
    }

    public void setTimeStamp(Date timestamp) {
        this.timestamp = timestamp;
    }
    
    public Object getBody() {
        return timestamp;
    }

    public void setBody(Object body) {
        this.body = body;
    }
    
    
    
    public String getMsguid() {
		return msguid;
	}

	public void setMsguid(String msguid) {
		this.msguid = msguid;
	}

	public byte getMsgtype() {
		return msgtype;
	}

	public void setMsgtype(byte msgtype) {
		this.msgtype = msgtype;
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	@Override
    public String toString() {
    	return "[msguid=" + msguid + ",msgtype=" + msgtype
    			+ ",status=" + status + ",timestamp=" + timestamp + ",desc=" + desc + ",body=" + body + "]";
    }
}
